package com.cqut.service.impl;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cqut.dao.WorkManagementMapper;
import com.cqut.dto.LimitShowDTO;
import com.cqut.service.IWorkManagementService;

@Service
public class WorkManagementService implements IWorkManagementService {
	@Resource(name = "workManagementMapper")
	private WorkManagementMapper workManagementMapper;

	@Override
	public List<Map<String, Object>> getProcesses() {
		// TODO Auto-generated method stub
		return workManagementMapper.getProcesses();
	}

	@Override
	public List<Map<String, Object>> getSubmission() {
		// TODO Auto-generated method stub
		return workManagementMapper.getSubmission();
	}

	@Override
	public List<Map<String, Object>> findWorkWithLimit(String competitionName, String phaseName,
			String competitionProcess, String submission, LimitShowDTO limitShowDTO) {
		// TODO Auto-generated method stub
		return workManagementMapper.findWorkByLimit(competitionName,phaseName,competitionProcess,submission,limitShowDTO.calculateStart(),limitShowDTO.calculateEnd());
	}

	@Override
	public long findCountWithLimit(String competitionName, String phaseName, String competitionProcess,
			String submission, LimitShowDTO limitShowDTO) {
		// TODO Auto-generated method stub
		return workManagementMapper.findCountByLimit(competitionName,phaseName,competitionProcess,submission,limitShowDTO.calculateStart(),limitShowDTO.calculateEnd());
	}
}
